<?php 
session_start();include "conn.php";
?>
<?php  include("admin.php");?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />



<title> Bios 管理中心 </title>
<link href="../css/control.css" rel="stylesheet" type="text/css" />
</head>

<body>





<div id="all"><!--Wrap start //-->
<div id="main" class="clearfix"><!--main start //-->
<div id="top-1"><?php include_once('blog_top_btn.php');?>
</div>
<!--Content for  id "submenu" Goes Here //-->
<div id="submenu">
<?php include_once('news2_main_btn.php');?>
  </div>
 <!--Content for  id "contact" Goes Here //-->
 
 <?php
//文件名。。。
 $webname="news2"; 
?>
 
 <?php
$id=make_safe($_GET["id"]);
$images=make_safe($_GET["images"]);
$action=make_safe($_GET["action"]);
$item =make_safe($_POST["items"]);

include("check.php");


//删除数据
if ($id!="" and $action=="del") {
	

			
		$sql="select * from ".$webname."  where id in (".$id.")  ";			
	$result=mysql_query($sql);
	while ($row=mysql_fetch_object($result)){
     
	if($row->images){unlink($row->images);unlink("pic/".$row->images);}
	if($row->images2){unlink($row->images2);unlink("pic/".$row->images2);}
	if($row->images3){unlink($row->images3);unlink("pic/".$row->images3);}
	if($row->images4){unlink($row->images4);unlink("pic/".$row->images4);}
	if($row->images5){unlink($row->images5);unlink("pic/".$row->images5);}
	if($row->images6){unlink($row->images6);unlink("pic/".$row->images6);}
	if($row->images7){unlink($row->images7);unlink("pic/".$row->images7);}
	if($row->images8){unlink($row->images8);unlink("pic/".$row->images8);}
	if($row->images9){unlink($row->images9);unlink("pic/".$row->images9);}
	
	}	
	
	$sql="Delete from ".$webname."   where id in (".$id.")";
			$result=mysql_query($sql);	
			
	
	echo "<script>window.location.href='news2_manage.php?page=".$page."&newsid=".$newsid."&title=".urlencode($title)."';</script>";

}
?>
 
 
 
 
 
 
 
 
 
 
 <div id="contact">
   

   
    <?php 
		
		 $title2=make_safe($_GET["title2"]);
		 $isok=make_safe($_GET["isok"]);
		 $BigClassName=make_safe($_GET["BigClassName"]);
		 $BigClassName2=make_safe($_GET["BigClassName2"]);
		 $BigClassName3=make_safe($_GET["BigClassName3"]);
		 $BigClassName4=make_safe($_GET["BigClassName4"]);
		 $BigClassName5=make_safe($_GET["BigClassName5"]);
		 
   if($page){
    $page_size=10;
	$sql="select count(*) as total from ".$webname." where newsid='$newsid' ";	
	$result=mysql_query($sql);
    $message_count=mysql_result($result,0,"total");
    $page_count=ceil($message_count/$page_size);	
    $offset=($page-1)*$page_size;	
	$sql="select * from ".$webname." where newsid='$newsid' ";
	$sql=$sql."order by id desc limit $offset, $page_size";
	$result=mysql_query($sql);
	while ($row=mysql_fetch_object($result)){
	?>
   
   
   <table border="0" cellspacing="0" cellpadding="0">
     <tr>
       <td>文章標題：<?php echo $title;?></td>
     </tr>
	 
	 
	 <tr>
       <td>分頁內容：<?php echo utf8substr($row->content,0,300);?></td>
     </tr>
     
    
      <tr>
        <td><ul>
          <li><a href="news2_xiugai.php?id=<?php echo $row->id;?>&newsid=<?php echo $newsid;?>&title=<?php echo urlencode($title);?>">編輯分頁</a></li>
		  
		  
		  
		  
     <?php if($_SESSION["box11"]==1 or $_SESSION["box22"]==1  or $_SESSION["box33"]==1){?>     <li><a href="?action=del&id=<?php echo $row->id;?>&newsid=<?php echo $newsid;?>&title=<?php echo urlencode($title);?>">刪除</a></li><?php }?>
	 
	 
	
        </ul></td>
      </tr>
      </table>
   <?php }}?>
   
 </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  <!--Content for  id "contact_page" Goes Here //-->
<div align="center">總共&nbsp;<?php echo $message_count;?> 條記錄&nbsp;&nbsp;頁次：
			  <?php 
			  $BigClassName=make_safe($_GET["BigClassName"]);
			  $BigClassName=urlencode($BigClassName);
			  if($page!=1)
				   {
				     echo  "<a href=?page=1&BigClassName=".$BigClassName.">首頁</a>&nbsp;&nbsp;&nbsp;";
					 echo "<a href=?page=".($page-1)."&BigClassName=".$BigClassName.">上一頁</a>&nbsp;&nbsp;&nbsp;";
				   } echo $page;?> / <?php echo $page_count;?> 頁&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
              <?php
	  		  
				  if($page<$page_count)
				   {
				        echo "<a href=?page=".($page+1)."&BigClassName=".$BigClassName.">下一頁</a>&nbsp;&nbsp;&nbsp;";
				        echo  "<a href=?page=".$page_count."&BigClassName=".$BigClassName.">尾頁</a>&nbsp;&nbsp;&nbsp;&nbsp;";
				   
				   }
				   
				 
				?>
                 &nbsp;&nbsp;&nbsp;跳轉到
                 <script type="text/javascript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
                 <select name="jumpMenu" id="jumpMenu" onChange="MM_jumpMenu('self',this,0)">
                 
                 <?php 
				 for($i=1;$i<=$page_count;$i++){
				 ?>
                   <option value="?page=<?php echo $i;?>" <?php if($page==$i){echo "selected";}?>><?php echo $i;?></option>
                   <?php }?>
                   </select>頁</div>
</div><!-- main end //-->
</div><!--Wrap end //-->
<div id="botton">
 <?php include_once('blog_botton_btn.php');?>
</div>
</body>
</html>
